package io.github.bigbird0101.youyishi.code.event;

import io.github.bigbird0101.youyishi.code.compile.CodeMetadata;


import java.util.List;

/**
 * @author m15179835326@163.com
 * @date 2023-05-12 14:56
 */
public class RunFailedEvent extends CodeEvent {
    private final Throwable throwable;

    public RunFailedEvent(List<CodeMetadata> codeMetadatas, Throwable throwable) {
        super(codeMetadatas);
        this.throwable = throwable;
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<CodeMetadata> getSource() {
        return (List<CodeMetadata>) super.getSource();
    }

    public Throwable getThrowable() {
        return throwable;
    }
}